package 力扣日常刷题.木22二月.第18天224;

import java.util.Scanner;

/**
 * @author 帅小伙
 * @date 2022/2/25
 * @description
 */
public class Demo148字节跳动2017后端工程师实习生笔试题3 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long x = scanner.nextLong(), k = scanner.nextLong();
        long bi = 1;
        long ans = 0;
        while (k != 0) {
            if((x & bi) == 0) {
                ans += (bi * (k & 1));
                k >>= 1;
            }
            bi <<= 1;
        }
        System.out.println(ans);
    }

}
